package edu.hgnc.test;


import edu.hgnc.selfAutowired.UserController;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import java.io.IOException;

import static org.assertj.core.api.Assertions.assertThat;

/**
 *测试创建代理代码，扩展spring的bean代理对象
 * 在对象之前，之后执行操作。
 */
public class JustTest7 {

	private static final Log logger = LogFactory.getLog(JustTest7.class);



	@Test
	public void test01() throws IOException {
		logger.info("我是日志，要要打印了1");
		System.out.println("======================================================");
		System.out.println("hello,when you see me,that's mean you are test succeed~");
		System.out.println("======================================================");
	}




	@Test
	public void test02() {
		ApplicationContext context = new ClassPathXmlApplicationContext("testAutoGet.xml");
	//	 模拟 http 调用Controller...
		UserController userController = context.getBean(UserController.class);
		userController.queryUsername();
	}

}
